<!--
  @author heguanghua
  @since 2020/04/23 13:44
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/staff/detail.action')},
     hasList=${#authPermit.checkPermit('/staff/list.action')},
     hasAddEdit=${#authPermit.checkPermit('/staff/modify/addEdit.action')},
     hasArchives=${#authPermit.checkPermit('/staff/staffarchives/addEditView.action')},
     hasContract=${#authPermit.checkPermit('/staff/staffcontract/addEditView.action')},
     hasFamily=${#authPermit.checkPermit('/staff/stafffamily/listByStaffId.action')},
     hasLeaveoffice=${#authPermit.checkPermit('/staff/staffleaveoffice/addEditView.action')},
     hasPerformance=${#authPermit.checkPermit('/staff/staffperformance/listByStaffId.action')},
     hasChangelog=${#authPermit.checkPermit('/staff/staffchangelog/list.action')},
     hasStaffRoleList=${#authPermit.checkPermit('/staff/role/list.action')},
     hasDpermitOrganizeList=${#authPermit.checkPermit('/staff/dpermit/organize/tree.action')},
     hasRoleDetail=${#authPermit.checkPermit('/role/detail.action')},
     hasAddRole=${#authPermit.checkPermit('/staff/role/modify/add.action') && isAssignAdmin},
     hasCancelRole=${#authPermit.checkPermit('/staff/role/modify/cancel.action') && isAssignAdmin}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/staff/list.action|">员工管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/staff/detail.action?staffId=${obj.staffId}|" th:lay-text="员工账号" th:text="${obj.staffName}">staffName</a>&nbsp;&nbsp;>&nbsp;
        角色授权
    </blockquote>

    <div class="layui-card">
        <div th:replace="staff/_tab::tab"></div>
        <form method="POST" class="layui-form" action="/staff/role/list.action">
            <div th:replace="staff/role/_query::query"></div>
        </form>

        <div class="layui-card-body">
            <blockquote class="layui-elem-quote layui-quote-nm">
                "系统全局角色"具有极大权限，谨慎授权给员工。
            </blockquote>
            <div th:replace="staff/role/_table::table"></div>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm" lay-event="cancel" th:if="${hasCancelRole}">取消授权</button>
                    </div>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="add" th:if="${hasAddRole}">+新增授权</button>
                    </div>
                </div>
            </script>
        </div>
    </div>
</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        staffId: [[${vo.staffId}]],
        status: [[${vo.status}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]]
    };

    layui.extend({
        staff_role_list: "staff/zmn.staff.role.list"
    }).use(['index', 'staff_role_list']);
</script>
